package com.qzh.QVM.Simulator;

import java.util.ArrayList;
import java.util.List;

/**
 * 环境模拟
 */
public class Environment {
    private static Environment instance;
    private static Manager manager;
    private static final int totalBlockSize = 10000;

    /**
     * 单例模式
     * @return
     */
    public static Environment getInstance(){
        if(instance == null){
            instance = new Environment();
            manager = Manager.getInstance(totalBlockSize);
            manager.setCrossField(false);
            manager.setOldCleanUsedCount(5);
            manager.setYoungCleanUsedCount(5);
            manager.setYoungToOldUsedCount(5);
            manager.setOldToEternityUsedCount(5);
        }
        return instance;
    }





    public static void main(String[] args) {
           manager =  Manager.getInstance(totalBlockSize);
           manager.setCrossField(false);
           manager.setOldCleanUsedCount(5);
           manager.setYoungCleanUsedCount(5);
           manager.setYoungToOldUsedCount(5);
           manager.setOldToEternityUsedCount(5);
           manager.circle();
           manager.clean();


    }


}
